home *** CD-ROM | disk | FTP | other *** search
- Example of C Functions With C++ Key Word Names
-
- This code doesn't work:
-
- new.cpp:
- extern int new();
-
- main()
- {
- int x = new();
- }
-
- So replace it with this code:
-
- example2.h:
- #ifndef __cplusplus
- extern int new();
- #endif
- #ifdef __cplusplus
- extern int new_one();
- #endif
-
- example2.c:
-
- #include "example2.h"
-
- int new_one()
- {
- return(new());
- }
-
-
- new2.cpp:
-
- #include "example2.h"
-
- main()
- {
- int x = new_one();
- }
-
-